package com.hdf.etdemo;
import java.io.File;


import com.hdf.easytools.config.ImageLoaderConfig;
import com.umeng.analytics.MobclickAgent;
import com.baidu.mapapi.SDKInitializer;
import android.app.Application;
import android.os.Environment;
import android.util.Log;

public class EasyToolsApplication extends Application{
	/** SDCard路径*/
	public static final String SD_PATH = Environment
			.getExternalStorageDirectory().getAbsolutePath();
	/** 文件夹路径*/
	public static final String BASE_PATH = SD_PATH + "/easytools/";

	/** 缓存图片路径*/
	public static final String BASE_IMAGE_CACHE = BASE_PATH + "easytools/images/";
	
	
	
	@Override
	public void onCreate() {
		SDKInitializer.initialize(this);//百度地图
		createDir();
		ImageLoaderConfig.initImageLoader(this, new File(BASE_IMAGE_CACHE));
		MobclickAgent.setDebugMode(true);//友盟统计
		
	}

	/**
	 * 创建APP目录
	 */
	private void createDir() {
		File fileApplication = new File(BASE_PATH);
		File fileCacheImg = new File(BASE_IMAGE_CACHE);
		if (!fileApplication.exists()) {
			fileApplication.mkdirs();
		}
		
		if (!fileCacheImg.exists()) {
			fileCacheImg.mkdirs();
		}
	}
}
